package ctrl

import "github.com/astaxie/beego"

type Controller struct {
	beego.Controller
}

func (c *Controller) ResponseFailed(status int, message string) {
	result := make(map[string]interface{})
	result["status"] = status
	result["message"] = message
	c.Data["json"] = result
	c.ServeJSON()
}

func (c *Controller) ResponseSuccess() {
	result := make(map[string]interface{})
	result["status"] = 200
	result["message"] = "success"
	c.Data["json"] = result
	c.ServeJSON()
}
